<div class="table-responsive-vertical md-whiteframe-z1" ng-controller="StockInfoController">
  <md-toolbar class="md-table-toolbar md-default md-padding search" >
    <div layout layout-sm="column">
	  <md-input-container flex>
        <label>股票编码</label>
        <input ng-model="query.stockCode">
      </md-input-container>
      <md-input-container flex>
        <label>股票名称</label>
        <input ng-model="query.stockName">
      </md-input-container>
      <md-input-container flex>
        <label>板块类别</label> 
        <md-select ng-model="query.stockType">
          <md-option value="%">全部</md-option>
          <md-option value="sz">深圳</md-option>
          <md-option value="sh">上海</md-option>
        </md-select>
      </md-input-container>
     
      <md-input-container layout layout-align="end start">
        <md-button class="md-raised " ng-click="queryItems(true)">
          <i class="material-icons md-light">search</i>
          <span>查询</span>
        </md-button>
        <md-button class="md-raised" ng-click="createItem()">
          <i class="material-icons md-light">add</i>
          <span>新增</span>
        </md-button>
      </md-input-container>
    </div>
  </md-toolbar>

  <md-toolbar class="md-table-toolbar alternate" >
    <div class="md-toolbar-tools">
      <span ng-show="selectedItems.length">已选中{{selectedItems.length}}行</span>
      <span ng-show="!selectedItems.length">请选中数据再进行操作</span>
      <span flex></span>
      <md-button class="md-raised" ng-click="collectDetail()">
         <i class="material-icons md-light">cloud_download</i>
         <span>采集详情</span>
       </md-button>
       <md-button class="md-raised md-warn" ng-click="batchDeleteItem()" ng-disabled="!selectedItems.length">
         <i class="material-icons md-light">delete</i>
         <span>批量删除</span>
       </md-button>
    </div>
  </md-toolbar>

  <md-table-container>
    <table md-table  md-row-select="tableOptions.rowSelection" multiple="{{tableOptions.multiSelect}}" ng-model="selectedItems" class="table table-hover table-bordered" md-progress="promise">
      <thead md-head md-order="query.order" md-on-reorder="queryItems">
        <tr md-row>
          <th md-column ng-repeat="col in tableCols" md-order-by="{{col.orderBy}}">{{col.name}}</th>
          <th md-column md-order-by="stockType">板块类别</th>
          <th md-column>操作</th>
        </tr>
      </thead>
        <tbody md-body>
        <tr md-row md-select="item" x-md-auto-select="tableOptions.autoSelect" ng-repeat="item in tableData">
            <td md-cell ng-repeat="col in tableCols"><nobr><span dynamic-bind="col.id" dynamic-bind-pre="item"></span></nobr></td>
        	<td md-cell><nobr><span ng-bind="item.stockType=='sz'?'深圳':'上海'"></span></nobr></td>
       		<td md-cell><div class="md-button-group">
	       		<md-button class="md-raised md-primary" ng-click="updateItem(item.stockId)">
		         <i class="material-icons md-light">edit</i>
		         <span>编辑</span>
		       	</md-button>
		       	<md-button class="md-raised md-warn" ng-click="deleteItem(item.stockId)">
		         <i class="material-icons md-light">delete</i>
		         <span>删除</span>
		       	</md-button>
		       	<md-button class="md-raised md-accent" ng-click="setMonster(item.stockId)">
		         <i class="material-icons md-light">stars</i>
		         <span>妖股</span>
		       	</md-button></div>
	       </td>
        </tr>
        </tbody>
    </table>
  </md-table-container>

  <md-table-pagination class="table-pagination" md-label="{{tableOptions.label}}" md-limit="query.limit" md-limit-options="tableOptions.limitOptions" md-page="query.page" md-total="{{totalItems}}" md-on-paginate="queryItems" md-page-select="tableOptions.pageSelect"></md-table-pagination>
</div>
   


<script type="text/ng-template" id="stock-info-edit.html">
		<md-input-container flex>
        	<label>板块类别</label>
			<md-select ng-model="formData.stockType">
         	 	<md-option value="sz">深圳</md-option>
          		<md-option value="sh">上海</md-option>
        	</md-select>
        </md-input-container>

    	<md-input-container flex>
        	<label>编码</label>
        	<input ng-model="formData.stockCode">
        </md-input-container>

		<md-input-container flex>
        	<label>名称</label>
        	<input ng-model="formData.stockName">
        </md-input-container>
</script>


<script type="text/ng-template" id="stock-monster-edit.html">
      	<md-input-container flex>
          <label>编码</label>
          <input ng-model="formData.stockCode" readOnly>
        </md-input-container>

    	<md-input-container flex>
          <label>名称</label>
          <input ng-model="formData.stockName" readOnly>
        </md-input-container>

    	<md-input-container flex>
          <label>采集时间</label>
      	  <md-datetime dt-type="date" choice="formData.collectTime"></md-datetime>
        </md-input-container>
</script>
  
  
